package cn.java79.springboot.zsb.ctrl;

import cn.java79.springboot.zsb.pojo.AjaxResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author oldliu
 * @since 1.0
 */
@ControllerAdvice
@ResponseBody
public class ExcepAdvisor {
    @ExceptionHandler(Exception.class)
    public AjaxResult exc(Exception e){
        return AjaxResult.error(e.getMessage());
    }
}
